#ifndef _GAME_H_
#define _GAME_H_

#include "screen.hpp"

#include "vec.hpp"

class Enemy;
class Door;

class Sound;

class GameScreen : public Screen
{
public:	
	GameScreen();
	~GameScreen();

	bool Open();
	void Close();

	void StatReset();
	void SameStageReset()
	{
		StageReset(stagen);
	}
	void StageReset(int newstagen);

	void In();

	bool DoorScrolling();
	void ActScan();
	void Update();
	void CamLimUpdate();
	void CkptUpdate();
	
	void Out(float upfrac);

	void Score(int pts);

	void ClearBonusUpdate();

	void StageSet(int stg)	
	{
		stagen = stg;
	}
	void CkptSet(int ck)
	{
		ckpt = ck;
	}

	bool Pause()
	{
		return pause;
	}

	enum State
	{
		PLAY,
		DOOR,
		DEAD,
		BOSSREADY,
		CLEAR
	};

	void StateChange(int s);

	friend class Player;
	friend class Enemy;
	friend class Weapon;

private:
	int state;
	int sttime;

	int lives;
	int score;
	int extscore;
	int stagen;
	int ckpt;
	int stgtime;

	Enemy *boss;
	Door *nextdoor;
	Door *prevdoor;

	bool pause;

	Sound *snd;
};

extern GameScreen Game;

#endif

